From 068045a2571c8750388ddfb68185920917b06186 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 1 Dec 2015 01:58:57 -0800 Subject: [PATCH] Remove unused WikiPage::getLastNAuthors() method Change-Id: I06b617d7af5169046b484d22931922bf2f9a5b74 --- includes/page/WikiPage.php | 49 -------------------------------------- 1 file changed, 49 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 98bca0525b..f54fde6b0d 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1027,55 +1027,6 @@ class WikiPage implements Page, IDBAccessObject { return new UserArrayFromResult( $res ); } - /** - * Get the last N authors - * @param int $num Number of revisions to get - * @param int|string $revLatest The latest rev_id, selected from the master (optional) - * @return array Array of authors, duplicates not removed - */ - public function getLastNAuthors( $num, $revLatest = 0 ) { - // First try the slave - // If that doesn't have the latest revision, try the master - $continue = 2; - $db = wfGetDB( DB_SLAVE ); - - do { - $res = $db->select( array( 'page', 'revision' ), - array( 'rev_id', 'rev_user_text' ), - array( - 'page_namespace' => $this->mTitle->getNamespace(), - 'page_title' => $this->mTitle->getDBkey(), - 'rev_page = page_id' - ), __METHOD__, - array( - 'ORDER BY' => 'rev_timestamp DESC', - 'LIMIT' => $num - ) - ); - - if ( !$res ) { - return array(); - } - - $row = $db->fetchObject( $res ); - - if ( $continue == 2 && $revLatest && $row->rev_id != $revLatest ) { - $db = wfGetDB( DB_MASTER ); - $continue--; - } else { - $continue = 0; - } - } while ( $continue ); - - $authors = array( $row->rev_user_text ); - - foreach ( $res as $row ) { - $authors[] = $row->rev_user_text; - } - - return $authors; - } - /** * Should the parser cache be used? * -- 2.20.1